package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "无相之风")
@Order(1006)
@Component
public class WuXiangFeng extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int dmg;
        String desc;
        int orgAtk = first.getBattleInfo().getSpd()/2;
        int def = second.getBattleInfo().getRes();
        int atk = (int) (orgAtk * 1.2);
        dmg = battleHelper.calAtk(atk, def);
        desc = RandomUtil.choice(Lists.newArrayList("风蝶天刃", "席卷八荒", "烈风冲击波"));

        battleHelper.autoAction(this, first, second, content, dmg, desc);
    }

    @Override
    public void limit(UserBO user) {
        throw new HandlerException("无法学习妖兽的攻击手段");
    }

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return "代号为「贝特」的高级风元素生命。\n" +
                "「无相」指的是抛弃了其他元素生物的形态与生态，达到的纯粹境地。\n" +
                "针对无相元素的研究，主要由须弥教令院的学者主导进行。但由于其危险性，除了代号和命名以外，基本没有取得什么值得参考的研究成果…\n\n" +
                "会根据自己的速度对玩家造成法术伤害 \n" +
                "技能 ：风蝶天刃,席卷八荒,烈风冲击波\n\n" +
                "掉落物：\n" +
                "自在松石碎屑，自在松石断片，自在松石块";
    }


}
